import { defineComponent, defineAsyncComponent, PropType } from '@vue/runtime-core';
import { showNumber } from '/@/types/config';
import rosary from './rosary/index';

export default defineComponent({
  name: 'prayers',
  components: { rosary },
  props: {
    prayersname: {
      type: String,
      default: 'father',
    },
    showtype: {
      type: Number as PropType<showNumber>,
    },
  },
  setup(props) {
    function renderFather(name: string) {
      const father = defineAsyncComponent(() => import(`./components/${name}.vue`));
      return (
        <>
          <father />
        </>
      );
    }

    function renderRosary() {
      return (
        <>
          <rosary />
        </>
      );
    }

    return () => {
      return (
        <>
          {renderFather(props.prayersname)}
          {renderRosary()}
        </>
      );
    };
  },
});
